package com.wiscamp.ninechapters.panels.infrastructure.views;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 用户表
 */
@Data
@Entity
@Table(name = "users_view")
public class UserView {

    /**
     * 用户编号
     */
    @Id
    @Column(name = "user_id", nullable = false)
    private Long userId = 0L;

    /**
     * 应用编号
     */
    @Column(name = "application_id", nullable = false)
    private Long applicationId = 0L;

    /**
     * 用户代码
     */
    @Column(name = "user_code", nullable = false)
    private String userCode = "";

    /**
     * 用户姓名
     */
    @Column(name = "user_name", nullable = false)
    private String userName = "";

    /**
     * 用户类型编号
     */
    @Column(name = "user_type_id", nullable = false)
    private Long userTypeId = 0L;

    /**
     * 账号类型编号
     */
    @Column(name = "account_type_id", nullable = false)
    private Long accountTypeId = 0L;

    /**
     * 加密口令
     */
    @Column(name = "password", nullable = false)
    private String password = "";

    /**
     * 关联账户编号
     */
    @Column(name = "reference_id", nullable = false)
    private Long referenceId = 0L;

    /**
     * 关联账户代码
     */
    @Column(name = "reference_code", nullable = false)
    private String referenceCode = "";

    /**
     * 组织机构编号
     */
    @Column(name = "organization_id", nullable = false)
    private Long organizationId = 0L;

    /**
     * 成员编号
     */
    @Column(name = "person_id", nullable = false)
    private Long personId = 0L;

    /**
     * 邮箱
     */
    @Column(name = "email", nullable = false)
    private String email = "";

    /**
     * 手机号码
     */
    @Column(name = "cellphone", nullable = false)
    private String cellphone = "";

    /**
     * 备注
     */
    @Column(name = "remark", nullable = false)
    private String remark = "";

    /**
     * 创建用户
     */
    @Column(name = "creator_id", nullable = false, updatable = false)
    private Long creatorId = 0L;

    /**
     * 创建时间
     */
    @Column(name = "creation_time", nullable = false, updatable = false)
    private LocalDateTime creationTime;

    /**
     * 编辑用户
     */
    @Column(name = "modifier_id", nullable = false)
    private Long modifierId = 0L;

    /**
     * 编辑时间
     */
    @Column(name = "modification_time", nullable = false)
    private LocalDateTime modificationTime;

    /**
     * 是否启用
     */
    @Column(name = "enabled", nullable = false)
    private boolean enabled = true;

    /**
     * 是否删除
     */
    @Column(name = "deleted", nullable = false)
    private boolean deleted = false;

    /**
     * 用户组类型名称
     */
    @Column(name = "user_type_name", nullable = false)
    private String userTypeName = "";

    /**
     * 用户组类型名称
     */
    @Column(name = "account_type_name", nullable = false)
    private String accountTypeName = "";

    /**
     * 创建人名称
     */
    @Column(name = "creator_name", nullable = false)
    private String creatorName = "";

    /**
     * 编辑人名称
     */
    @Column(name = "modifier_name", nullable = false)
    private String modifierName = "";
}
